//
//  Dire_ThreeViewController.m
//  MagicBox
//
//  Created by dllo on 16/8/15.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Dire_ThreeViewController.h"
#import "Dire_View.h"

@interface Dire_ThreeViewController ()
@property (nonatomic, retain) UIButton *button;
@property (nonatomic, retain) UITextField *textField;

@end

@implementation Dire_ThreeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIImageView *imageview = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"uw338_600x.png"]];
    imageview.frame = self.view.bounds;
    [self.view addSubview:imageview];
    self.view.backgroundColor = [UIColor whiteColor];
    self.textField  = [[UITextField alloc]init];
    _textField.placeholder = @"请输入直播标题";
    _textField.font = [UIFont systemFontOfSize:30];
    _textField.textColor = [UIColor blackColor];
    _textField.frame = CGRectMake(SCREENWIDTH/4, SCREENHEIGHT/5, SCREENWIDTH/2, SCREENHEIGHT/7);
    [self.view addSubview:_textField];
    
    self.button = [UIButton buttonWithType:UIButtonTypeSystem];
//    _button.backgroundColor = [UIColor whiteColor];
    _button.titleLabel.font = [UIFont systemFontOfSize:40];
    
    [_button setTitle:@"开始直播" forState:UIControlStateNormal];
    
    _button.frame = CGRectMake(SCREENWIDTH/4, SCREENHEIGHT/3.5, SCREENWIDTH/2, SCREENHEIGHT/7);
    [_button addTarget:self action:@selector(buttonAction:)forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:_button];

    
    
}
-(void)buttonAction:(UIButton*)button{
    Dire_View *view = [[Dire_View alloc]initWithFrame:self.view.bounds];
    
    [self.view addSubview:view];
    self.navigationItem.title = self.textField.text;
 
    _button.hidden = YES;
    _textField.hidden = YES;

   
    self.tabBarController.tabBar.hidden = YES;
    
    
}
-(void)viewWillDisappear:(BOOL)animated{
    
  
    self.tabBarController.tabBar.hidden = NO;
    
}





- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
